<?php
declare (strict_types = 1);
namespace app\topic\model;

use think\model\concern\SoftDelete;
use app\common\model\BaseModel;
use app\user\logic\user\Account as User;

/**
 * 定义资讯评论点赞数据模型
 */
class TopicCommentReplyLike extends BaseModel
{
    use softDelete;
    /**
     * 表名
     * @var string
     */
    protected $name = 'topic_comment_reply_like';
    
    /**
     * 设置自动写入时间
     * @var boolean
     */
    protected $autoWriteTimestamp = true;
    protected $updateTime = false;

    /**
     * 定义字段类型
     * @var array
     */
    protected $type = [
        'id'          => 'integer',
        'title'       => 'string',
        'abstract'    => 'string',
        'content'     => 'string',
        'create_time' => 'integer'
    ];

    /**
     * 定义表主键
     * @var string
     */
    protected $pk = 'id';


    public function user()
    {
        return $this->belongsTo(User::class, 'user_id')->bind([
            'nick_name','avatar_url'
        ]);
    }
}
